// Copyright 2018-2020 Polyaxon, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/* tslint:disable */
/* eslint-disable */
/**
 * Polyaxon SDKs and REST API specification.
 * Polyaxon SDKs and REST API specification.
 *
 * The version of the OpenAPI document: 1.2.1-rc1
 * Contact: contact@polyaxon.com
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */


import * as runtime from '../runtime';
import {
    RuntimeError,
    RuntimeErrorFromJSON,
    RuntimeErrorToJSON,
    V1ArtifactTree,
    V1ArtifactTreeFromJSON,
    V1ArtifactTreeToJSON,
    V1Auth,
    V1AuthFromJSON,
    V1AuthToJSON,
    V1EntitiesTags,
    V1EntitiesTagsFromJSON,
    V1EntitiesTagsToJSON,
    V1EntityNotificationBody,
    V1EntityNotificationBodyFromJSON,
    V1EntityNotificationBodyToJSON,
    V1EntityStatusBodyRequest,
    V1EntityStatusBodyRequestFromJSON,
    V1EntityStatusBodyRequestToJSON,
    V1EventsResponse,
    V1EventsResponseFromJSON,
    V1EventsResponseToJSON,
    V1ListBookmarksResponse,
    V1ListBookmarksResponseFromJSON,
    V1ListBookmarksResponseToJSON,
    V1ListRunArtifactsResponse,
    V1ListRunArtifactsResponseFromJSON,
    V1ListRunArtifactsResponseToJSON,
    V1ListRunsResponse,
    V1ListRunsResponseFromJSON,
    V1ListRunsResponseToJSON,
    V1Logs,
    V1LogsFromJSON,
    V1LogsToJSON,
    V1OperationBody,
    V1OperationBodyFromJSON,
    V1OperationBodyToJSON,
    V1ProjectEntityResourceRequest,
    V1ProjectEntityResourceRequestFromJSON,
    V1ProjectEntityResourceRequestToJSON,
    V1Run,
    V1RunFromJSON,
    V1RunToJSON,
    V1RunArtifact,
    V1RunArtifactFromJSON,
    V1RunArtifactToJSON,
    V1RunArtifacts,
    V1RunArtifactsFromJSON,
    V1RunArtifactsToJSON,
    V1RunSettings,
    V1RunSettingsFromJSON,
    V1RunSettingsToJSON,
    V1Status,
    V1StatusFromJSON,
    V1StatusToJSON,
    V1Uuids,
    V1UuidsFromJSON,
    V1UuidsToJSON,
} from '../models';

export interface ArchiveRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface BookmarkRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface BookmarkRunsRequest {
    owner: string;
    project: string;
    body: V1Uuids;
}

export interface CollectRunLogsRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    kind: string;
}

export interface CopyRunRequest {
    entityOwner: string;
    entityProject: string;
    entityUuid: string;
    body: V1Run;
}

export interface CreateRunRequest {
    owner: string;
    project: string;
    body: V1OperationBody;
}

export interface CreateRunArtifactsLineageRequest {
    owner: string;
    project: string;
    uuid: string;
    body: V1RunArtifacts;
}

export interface CreateRunStatusRequest {
    owner: string;
    project: string;
    uuid: string;
    body: V1EntityStatusBodyRequest;
}

export interface DeleteRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface DeleteRunArtifactRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    path?: string;
}

export interface DeleteRunArtifactLineageRequest {
    owner: string;
    project: string;
    uuid: string;
    name: string;
    namespace?: string;
}

export interface DeleteRunArtifactsRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    path?: string;
}

export interface DeleteRunsRequest {
    owner: string;
    project: string;
    body: V1Uuids;
}

export interface GetMultiRunEventsRequest {
    namespace: string;
    owner: string;
    project: string;
    kind: GetMultiRunEventsKindEnum;
    names?: string;
    runs?: string;
    orient?: string;
    force?: boolean;
}

export interface GetRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface GetRunArtifactRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    path?: string;
    stream?: boolean;
    force?: boolean;
}

export interface GetRunArtifactLineageRequest {
    owner: string;
    project: string;
    uuid: string;
    name: string;
    namespace?: string;
}

export interface GetRunArtifactsRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    path?: string;
    force?: boolean;
}

export interface GetRunArtifactsLineageRequest {
    owner: string;
    project: string;
    uuid: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface GetRunArtifactsLineageNamesRequest {
    owner: string;
    project: string;
    uuid: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface GetRunArtifactsTreeRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    path?: string;
}

export interface GetRunEventsRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    kind: GetRunEventsKindEnum;
    names?: string;
    orient?: string;
    force?: boolean;
}

export interface GetRunLogsRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    lastTime?: Date;
    lastFile?: string;
    force?: boolean;
}

export interface GetRunNamespaceRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface GetRunResourcesRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    names?: string;
    tail?: boolean;
    force?: boolean;
}

export interface GetRunSettingsRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface GetRunStatusesRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface GetRunsArtifactsLineageRequest {
    owner: string;
    project: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface ImpersonateTokenRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface InvalidateRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface InvalidateRunsRequest {
    owner: string;
    project: string;
    body: V1Uuids;
}

export interface ListArchivedRunsRequest {
    user: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface ListBookmarkedRunsRequest {
    user: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface ListRunsRequest {
    owner: string;
    project: string;
    offset?: number;
    limit?: number;
    sort?: string;
    query?: string;
}

export interface NotifyRunStatusRequest {
    namespace: string;
    owner: string;
    project: string;
    uuid: string;
    body: V1EntityNotificationBody;
}

export interface PatchRunRequest {
    owner: string;
    project: string;
    runUuid: string;
    body: V1Run;
}

export interface RestartRunRequest {
    entityOwner: string;
    entityProject: string;
    entityUuid: string;
    body: V1Run;
}

export interface RestoreRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface ResumeRunRequest {
    entityOwner: string;
    entityProject: string;
    entityUuid: string;
    body: V1Run;
}

export interface StartRunTensorboardRequest {
    owner: string;
    project: string;
    uuid: string;
    body: V1ProjectEntityResourceRequest;
}

export interface StopRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface StopRunTensorboardRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface StopRunsRequest {
    owner: string;
    project: string;
    body: V1Uuids;
}

export interface TagRunsRequest {
    owner: string;
    project: string;
    body: V1EntitiesTags;
}

export interface UnbookmarkRunRequest {
    owner: string;
    project: string;
    uuid: string;
}

export interface UpdateRunRequest {
    owner: string;
    project: string;
    runUuid: string;
    body: V1Run;
}

export interface UploadRunArtifactRequest {
    owner: string;
    project: string;
    uuid: string;
    uploadfile: Blob;
    path?: string;
    overwrite?: boolean;
}

export interface UploadRunLogsRequest {
    owner: string;
    project: string;
    uuid: string;
    uploadfile: Blob;
    path?: string;
    overwrite?: boolean;
}

/**
 * 
 */
export class RunsV1Api extends runtime.BaseAPI {

    /**
     * Archive run
     */
    async archiveRunRaw(requestParameters: ArchiveRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling archiveRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling archiveRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling archiveRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/archive`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Archive run
     */
    async archiveRun(requestParameters: ArchiveRunRequest): Promise<void> {
        await this.archiveRunRaw(requestParameters);
    }

    /**
     * Bookmark run
     */
    async bookmarkRunRaw(requestParameters: BookmarkRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling bookmarkRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling bookmarkRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling bookmarkRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/bookmark`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Bookmark run
     */
    async bookmarkRun(requestParameters: BookmarkRunRequest): Promise<void> {
        await this.bookmarkRunRaw(requestParameters);
    }

    /**
     * Bookmark runs
     */
    async bookmarkRunsRaw(requestParameters: BookmarkRunsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling bookmarkRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling bookmarkRuns.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling bookmarkRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/bookmark`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1UuidsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Bookmark runs
     */
    async bookmarkRuns(requestParameters: BookmarkRunsRequest): Promise<void> {
        await this.bookmarkRunsRaw(requestParameters);
    }

    /**
     * Collect run logs
     */
    async collectRunLogsRaw(requestParameters: CollectRunLogsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling collectRunLogs.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling collectRunLogs.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling collectRunLogs.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling collectRunLogs.');
        }

        if (requestParameters.kind === null || requestParameters.kind === undefined) {
            throw new runtime.RequiredError('kind','Required parameter requestParameters.kind was null or undefined when calling collectRunLogs.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/_internal/{owner}/{project}/runs/{uuid}/{kind}/logs`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))).replace(`{${"kind"}}`, encodeURIComponent(String(requestParameters.kind))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Collect run logs
     */
    async collectRunLogs(requestParameters: CollectRunLogsRequest): Promise<void> {
        await this.collectRunLogsRaw(requestParameters);
    }

    /**
     * Restart run with copy
     */
    async copyRunRaw(requestParameters: CopyRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.entityOwner === null || requestParameters.entityOwner === undefined) {
            throw new runtime.RequiredError('entityOwner','Required parameter requestParameters.entityOwner was null or undefined when calling copyRun.');
        }

        if (requestParameters.entityProject === null || requestParameters.entityProject === undefined) {
            throw new runtime.RequiredError('entityProject','Required parameter requestParameters.entityProject was null or undefined when calling copyRun.');
        }

        if (requestParameters.entityUuid === null || requestParameters.entityUuid === undefined) {
            throw new runtime.RequiredError('entityUuid','Required parameter requestParameters.entityUuid was null or undefined when calling copyRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling copyRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{entity.owner}/{entity.project}/runs/{entity.uuid}/copy`.replace(`{${"entity.owner"}}`, encodeURIComponent(String(requestParameters.entityOwner))).replace(`{${"entity.project"}}`, encodeURIComponent(String(requestParameters.entityProject))).replace(`{${"entity.uuid"}}`, encodeURIComponent(String(requestParameters.entityUuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Restart run with copy
     */
    async copyRun(requestParameters: CopyRunRequest): Promise<V1Run> {
        const response = await this.copyRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Create new run
     */
    async createRunRaw(requestParameters: CreateRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling createRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling createRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1OperationBodyToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Create new run
     */
    async createRun(requestParameters: CreateRunRequest): Promise<V1Run> {
        const response = await this.createRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Create bulk run artifacts lineage
     */
    async createRunArtifactsLineageRaw(requestParameters: CreateRunArtifactsLineageRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling createRunArtifactsLineage.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling createRunArtifactsLineage.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling createRunArtifactsLineage.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createRunArtifactsLineage.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts_lineage`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunArtifactsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Create bulk run artifacts lineage
     */
    async createRunArtifactsLineage(requestParameters: CreateRunArtifactsLineageRequest): Promise<void> {
        await this.createRunArtifactsLineageRaw(requestParameters);
    }

    /**
     * Create new run status
     */
    async createRunStatusRaw(requestParameters: CreateRunStatusRequest): Promise<runtime.ApiResponse<V1Status>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling createRunStatus.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling createRunStatus.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling createRunStatus.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling createRunStatus.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/statuses`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1EntityStatusBodyRequestToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1StatusFromJSON(jsonValue));
    }

    /**
     * Create new run status
     */
    async createRunStatus(requestParameters: CreateRunStatusRequest): Promise<V1Status> {
        const response = await this.createRunStatusRaw(requestParameters);
        return await response.value();
    }

    /**
     * Delete run
     */
    async deleteRunRaw(requestParameters: DeleteRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling deleteRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Delete run
     */
    async deleteRun(requestParameters: DeleteRunRequest): Promise<void> {
        await this.deleteRunRaw(requestParameters);
    }

    /**
     * Delete run artifact
     */
    async deleteRunArtifactRaw(requestParameters: DeleteRunArtifactRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling deleteRunArtifact.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteRunArtifact.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteRunArtifact.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling deleteRunArtifact.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/artifact`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Delete run artifact
     */
    async deleteRunArtifact(requestParameters: DeleteRunArtifactRequest): Promise<void> {
        await this.deleteRunArtifactRaw(requestParameters);
    }

    /**
     * Delete run artifact lineage
     */
    async deleteRunArtifactLineageRaw(requestParameters: DeleteRunArtifactLineageRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteRunArtifactLineage.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteRunArtifactLineage.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling deleteRunArtifactLineage.');
        }

        if (requestParameters.name === null || requestParameters.name === undefined) {
            throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling deleteRunArtifactLineage.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.namespace !== undefined) {
            queryParameters['namespace'] = requestParameters.namespace;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts_lineage/{name}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Delete run artifact lineage
     */
    async deleteRunArtifactLineage(requestParameters: DeleteRunArtifactLineageRequest): Promise<void> {
        await this.deleteRunArtifactLineageRaw(requestParameters);
    }

    /**
     * Delete run artifacts
     */
    async deleteRunArtifactsRaw(requestParameters: DeleteRunArtifactsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling deleteRunArtifacts.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteRunArtifacts.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteRunArtifacts.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling deleteRunArtifacts.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/artifacts`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Delete run artifacts
     */
    async deleteRunArtifacts(requestParameters: DeleteRunArtifactsRequest): Promise<void> {
        await this.deleteRunArtifactsRaw(requestParameters);
    }

    /**
     * Delete runs
     */
    async deleteRunsRaw(requestParameters: DeleteRunsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling deleteRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling deleteRuns.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling deleteRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/delete`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
            body: V1UuidsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Delete runs
     */
    async deleteRuns(requestParameters: DeleteRunsRequest): Promise<void> {
        await this.deleteRunsRaw(requestParameters);
    }

    /**
     * Get multi runs events
     */
    async getMultiRunEventsRaw(requestParameters: GetMultiRunEventsRequest): Promise<runtime.ApiResponse<V1EventsResponse>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getMultiRunEvents.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getMultiRunEvents.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getMultiRunEvents.');
        }

        if (requestParameters.kind === null || requestParameters.kind === undefined) {
            throw new runtime.RequiredError('kind','Required parameter requestParameters.kind was null or undefined when calling getMultiRunEvents.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.names !== undefined) {
            queryParameters['names'] = requestParameters.names;
        }

        if (requestParameters.runs !== undefined) {
            queryParameters['runs'] = requestParameters.runs;
        }

        if (requestParameters.orient !== undefined) {
            queryParameters['orient'] = requestParameters.orient;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/multi/events/{kind}`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"kind"}}`, encodeURIComponent(String(requestParameters.kind))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1EventsResponseFromJSON(jsonValue));
    }

    /**
     * Get multi runs events
     */
    async getMultiRunEvents(requestParameters: GetMultiRunEventsRequest): Promise<V1EventsResponse> {
        const response = await this.getMultiRunEventsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run
     */
    async getRunRaw(requestParameters: GetRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Get run
     */
    async getRun(requestParameters: GetRunRequest): Promise<V1Run> {
        const response = await this.getRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifact
     */
    async getRunArtifactRaw(requestParameters: GetRunArtifactRequest): Promise<runtime.ApiResponse<string>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunArtifact.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifact.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifact.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifact.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        if (requestParameters.stream !== undefined) {
            queryParameters['stream'] = requestParameters.stream;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/artifact`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.TextApiResponse(response) as any;
    }

    /**
     * Get run artifact
     */
    async getRunArtifact(requestParameters: GetRunArtifactRequest): Promise<string> {
        const response = await this.getRunArtifactRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifacts lineage
     */
    async getRunArtifactLineageRaw(requestParameters: GetRunArtifactLineageRequest): Promise<runtime.ApiResponse<V1RunArtifact>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifactLineage.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifactLineage.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifactLineage.');
        }

        if (requestParameters.name === null || requestParameters.name === undefined) {
            throw new runtime.RequiredError('name','Required parameter requestParameters.name was null or undefined when calling getRunArtifactLineage.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.namespace !== undefined) {
            queryParameters['namespace'] = requestParameters.namespace;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts_lineage/{name}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))).replace(`{${"name"}}`, encodeURIComponent(String(requestParameters.name))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunArtifactFromJSON(jsonValue));
    }

    /**
     * Get run artifacts lineage
     */
    async getRunArtifactLineage(requestParameters: GetRunArtifactLineageRequest): Promise<V1RunArtifact> {
        const response = await this.getRunArtifactLineageRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifacts
     */
    async getRunArtifactsRaw(requestParameters: GetRunArtifactsRequest): Promise<runtime.ApiResponse<string>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunArtifacts.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifacts.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifacts.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifacts.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/artifacts`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.TextApiResponse(response) as any;
    }

    /**
     * Get run artifacts
     */
    async getRunArtifacts(requestParameters: GetRunArtifactsRequest): Promise<string> {
        const response = await this.getRunArtifactsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifacts lineage
     */
    async getRunArtifactsLineageRaw(requestParameters: GetRunArtifactsLineageRequest): Promise<runtime.ApiResponse<V1ListRunArtifactsResponse>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifactsLineage.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifactsLineage.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifactsLineage.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts_lineage`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListRunArtifactsResponseFromJSON(jsonValue));
    }

    /**
     * Get run artifacts lineage
     */
    async getRunArtifactsLineage(requestParameters: GetRunArtifactsLineageRequest): Promise<V1ListRunArtifactsResponse> {
        const response = await this.getRunArtifactsLineageRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifacts lineage names
     */
    async getRunArtifactsLineageNamesRaw(requestParameters: GetRunArtifactsLineageNamesRequest): Promise<runtime.ApiResponse<V1ListRunArtifactsResponse>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifactsLineageNames.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifactsLineageNames.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifactsLineageNames.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts_lineage/names`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListRunArtifactsResponseFromJSON(jsonValue));
    }

    /**
     * Get run artifacts lineage names
     */
    async getRunArtifactsLineageNames(requestParameters: GetRunArtifactsLineageNamesRequest): Promise<V1ListRunArtifactsResponse> {
        const response = await this.getRunArtifactsLineageNamesRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run artifacts tree
     */
    async getRunArtifactsTreeRaw(requestParameters: GetRunArtifactsTreeRequest): Promise<runtime.ApiResponse<V1ArtifactTree>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunArtifactsTree.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunArtifactsTree.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunArtifactsTree.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunArtifactsTree.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/artifacts/tree`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ArtifactTreeFromJSON(jsonValue));
    }

    /**
     * Get run artifacts tree
     */
    async getRunArtifactsTree(requestParameters: GetRunArtifactsTreeRequest): Promise<V1ArtifactTree> {
        const response = await this.getRunArtifactsTreeRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run events
     */
    async getRunEventsRaw(requestParameters: GetRunEventsRequest): Promise<runtime.ApiResponse<V1EventsResponse>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunEvents.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunEvents.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunEvents.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunEvents.');
        }

        if (requestParameters.kind === null || requestParameters.kind === undefined) {
            throw new runtime.RequiredError('kind','Required parameter requestParameters.kind was null or undefined when calling getRunEvents.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.names !== undefined) {
            queryParameters['names'] = requestParameters.names;
        }

        if (requestParameters.orient !== undefined) {
            queryParameters['orient'] = requestParameters.orient;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/events/{kind}`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))).replace(`{${"kind"}}`, encodeURIComponent(String(requestParameters.kind))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1EventsResponseFromJSON(jsonValue));
    }

    /**
     * Get run events
     */
    async getRunEvents(requestParameters: GetRunEventsRequest): Promise<V1EventsResponse> {
        const response = await this.getRunEventsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run logs
     */
    async getRunLogsRaw(requestParameters: GetRunLogsRequest): Promise<runtime.ApiResponse<V1Logs>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunLogs.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunLogs.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunLogs.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunLogs.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.lastTime !== undefined) {
            queryParameters['last_time'] = (requestParameters.lastTime as any).toISOString();
        }

        if (requestParameters.lastFile !== undefined) {
            queryParameters['last_file'] = requestParameters.lastFile;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/logs`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1LogsFromJSON(jsonValue));
    }

    /**
     * Get run logs
     */
    async getRunLogs(requestParameters: GetRunLogsRequest): Promise<V1Logs> {
        const response = await this.getRunLogsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get Run namespace
     */
    async getRunNamespaceRaw(requestParameters: GetRunNamespaceRequest): Promise<runtime.ApiResponse<V1RunSettings>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunNamespace.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunNamespace.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunNamespace.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/namespace`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunSettingsFromJSON(jsonValue));
    }

    /**
     * Get Run namespace
     */
    async getRunNamespace(requestParameters: GetRunNamespaceRequest): Promise<V1RunSettings> {
        const response = await this.getRunNamespaceRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run resources events
     */
    async getRunResourcesRaw(requestParameters: GetRunResourcesRequest): Promise<runtime.ApiResponse<V1EventsResponse>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling getRunResources.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunResources.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunResources.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunResources.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.names !== undefined) {
            queryParameters['names'] = requestParameters.names;
        }

        if (requestParameters.tail !== undefined) {
            queryParameters['tail'] = requestParameters.tail;
        }

        if (requestParameters.force !== undefined) {
            queryParameters['force'] = requestParameters.force;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/resources`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1EventsResponseFromJSON(jsonValue));
    }

    /**
     * Get run resources events
     */
    async getRunResources(requestParameters: GetRunResourcesRequest): Promise<V1EventsResponse> {
        const response = await this.getRunResourcesRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get Run settings
     */
    async getRunSettingsRaw(requestParameters: GetRunSettingsRequest): Promise<runtime.ApiResponse<V1RunSettings>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunSettings.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunSettings.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunSettings.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/settings`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunSettingsFromJSON(jsonValue));
    }

    /**
     * Get Run settings
     */
    async getRunSettings(requestParameters: GetRunSettingsRequest): Promise<V1RunSettings> {
        const response = await this.getRunSettingsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get run statuses
     */
    async getRunStatusesRaw(requestParameters: GetRunStatusesRequest): Promise<runtime.ApiResponse<V1Status>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunStatuses.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunStatuses.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling getRunStatuses.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/statuses`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1StatusFromJSON(jsonValue));
    }

    /**
     * Get run statuses
     */
    async getRunStatuses(requestParameters: GetRunStatusesRequest): Promise<V1Status> {
        const response = await this.getRunStatusesRaw(requestParameters);
        return await response.value();
    }

    /**
     * Get runs artifacts lineage
     */
    async getRunsArtifactsLineageRaw(requestParameters: GetRunsArtifactsLineageRequest): Promise<runtime.ApiResponse<V1ListRunArtifactsResponse>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling getRunsArtifactsLineage.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling getRunsArtifactsLineage.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/artifacts_lineage`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListRunArtifactsResponseFromJSON(jsonValue));
    }

    /**
     * Get runs artifacts lineage
     */
    async getRunsArtifactsLineage(requestParameters: GetRunsArtifactsLineageRequest): Promise<V1ListRunArtifactsResponse> {
        const response = await this.getRunsArtifactsLineageRaw(requestParameters);
        return await response.value();
    }

    /**
     * Impersonate run token
     */
    async impersonateTokenRaw(requestParameters: ImpersonateTokenRequest): Promise<runtime.ApiResponse<V1Auth>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling impersonateToken.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling impersonateToken.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling impersonateToken.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/impersonate`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1AuthFromJSON(jsonValue));
    }

    /**
     * Impersonate run token
     */
    async impersonateToken(requestParameters: ImpersonateTokenRequest): Promise<V1Auth> {
        const response = await this.impersonateTokenRaw(requestParameters);
        return await response.value();
    }

    /**
     * Invalidate run
     */
    async invalidateRunRaw(requestParameters: InvalidateRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling invalidateRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling invalidateRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling invalidateRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/invalidate`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Invalidate run
     */
    async invalidateRun(requestParameters: InvalidateRunRequest): Promise<void> {
        await this.invalidateRunRaw(requestParameters);
    }

    /**
     * Invalidate runs
     */
    async invalidateRunsRaw(requestParameters: InvalidateRunsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling invalidateRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling invalidateRuns.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling invalidateRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/invalidate`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1UuidsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Invalidate runs
     */
    async invalidateRuns(requestParameters: InvalidateRunsRequest): Promise<void> {
        await this.invalidateRunsRaw(requestParameters);
    }

    /**
     * List archived runs for user
     */
    async listArchivedRunsRaw(requestParameters: ListArchivedRunsRequest): Promise<runtime.ApiResponse<V1ListRunsResponse>> {
        if (requestParameters.user === null || requestParameters.user === undefined) {
            throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling listArchivedRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/archives/{user}/runs`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListRunsResponseFromJSON(jsonValue));
    }

    /**
     * List archived runs for user
     */
    async listArchivedRuns(requestParameters: ListArchivedRunsRequest): Promise<V1ListRunsResponse> {
        const response = await this.listArchivedRunsRaw(requestParameters);
        return await response.value();
    }

    /**
     * List bookmarked runs for user
     */
    async listBookmarkedRunsRaw(requestParameters: ListBookmarkedRunsRequest): Promise<runtime.ApiResponse<V1ListBookmarksResponse>> {
        if (requestParameters.user === null || requestParameters.user === undefined) {
            throw new runtime.RequiredError('user','Required parameter requestParameters.user was null or undefined when calling listBookmarkedRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/bookmarks/{user}/runs`.replace(`{${"user"}}`, encodeURIComponent(String(requestParameters.user))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListBookmarksResponseFromJSON(jsonValue));
    }

    /**
     * List bookmarked runs for user
     */
    async listBookmarkedRuns(requestParameters: ListBookmarkedRunsRequest): Promise<V1ListBookmarksResponse> {
        const response = await this.listBookmarkedRunsRaw(requestParameters);
        return await response.value();
    }

    /**
     * List runs
     */
    async listRunsRaw(requestParameters: ListRunsRequest): Promise<runtime.ApiResponse<V1ListRunsResponse>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling listRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling listRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.offset !== undefined) {
            queryParameters['offset'] = requestParameters.offset;
        }

        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }

        if (requestParameters.sort !== undefined) {
            queryParameters['sort'] = requestParameters.sort;
        }

        if (requestParameters.query !== undefined) {
            queryParameters['query'] = requestParameters.query;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1ListRunsResponseFromJSON(jsonValue));
    }

    /**
     * List runs
     */
    async listRuns(requestParameters: ListRunsRequest): Promise<V1ListRunsResponse> {
        const response = await this.listRunsRaw(requestParameters);
        return await response.value();
    }

    /**
     * Notify run status
     */
    async notifyRunStatusRaw(requestParameters: NotifyRunStatusRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.namespace === null || requestParameters.namespace === undefined) {
            throw new runtime.RequiredError('namespace','Required parameter requestParameters.namespace was null or undefined when calling notifyRunStatus.');
        }

        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling notifyRunStatus.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling notifyRunStatus.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling notifyRunStatus.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling notifyRunStatus.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/streams/v1/{namespace}/{owner}/{project}/runs/{uuid}/notify`.replace(`{${"namespace"}}`, encodeURIComponent(String(requestParameters.namespace))).replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1EntityNotificationBodyToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Notify run status
     */
    async notifyRunStatus(requestParameters: NotifyRunStatusRequest): Promise<void> {
        await this.notifyRunStatusRaw(requestParameters);
    }

    /**
     * Patch run
     */
    async patchRunRaw(requestParameters: PatchRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling patchRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling patchRun.');
        }

        if (requestParameters.runUuid === null || requestParameters.runUuid === undefined) {
            throw new runtime.RequiredError('runUuid','Required parameter requestParameters.runUuid was null or undefined when calling patchRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling patchRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{run.uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"run.uuid"}}`, encodeURIComponent(String(requestParameters.runUuid))),
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Patch run
     */
    async patchRun(requestParameters: PatchRunRequest): Promise<V1Run> {
        const response = await this.patchRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Restart run
     */
    async restartRunRaw(requestParameters: RestartRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.entityOwner === null || requestParameters.entityOwner === undefined) {
            throw new runtime.RequiredError('entityOwner','Required parameter requestParameters.entityOwner was null or undefined when calling restartRun.');
        }

        if (requestParameters.entityProject === null || requestParameters.entityProject === undefined) {
            throw new runtime.RequiredError('entityProject','Required parameter requestParameters.entityProject was null or undefined when calling restartRun.');
        }

        if (requestParameters.entityUuid === null || requestParameters.entityUuid === undefined) {
            throw new runtime.RequiredError('entityUuid','Required parameter requestParameters.entityUuid was null or undefined when calling restartRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling restartRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{entity.owner}/{entity.project}/runs/{entity.uuid}/restart`.replace(`{${"entity.owner"}}`, encodeURIComponent(String(requestParameters.entityOwner))).replace(`{${"entity.project"}}`, encodeURIComponent(String(requestParameters.entityProject))).replace(`{${"entity.uuid"}}`, encodeURIComponent(String(requestParameters.entityUuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Restart run
     */
    async restartRun(requestParameters: RestartRunRequest): Promise<V1Run> {
        const response = await this.restartRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Restore run
     */
    async restoreRunRaw(requestParameters: RestoreRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling restoreRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling restoreRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling restoreRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/restore`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Restore run
     */
    async restoreRun(requestParameters: RestoreRunRequest): Promise<void> {
        await this.restoreRunRaw(requestParameters);
    }

    /**
     * Resume run
     */
    async resumeRunRaw(requestParameters: ResumeRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.entityOwner === null || requestParameters.entityOwner === undefined) {
            throw new runtime.RequiredError('entityOwner','Required parameter requestParameters.entityOwner was null or undefined when calling resumeRun.');
        }

        if (requestParameters.entityProject === null || requestParameters.entityProject === undefined) {
            throw new runtime.RequiredError('entityProject','Required parameter requestParameters.entityProject was null or undefined when calling resumeRun.');
        }

        if (requestParameters.entityUuid === null || requestParameters.entityUuid === undefined) {
            throw new runtime.RequiredError('entityUuid','Required parameter requestParameters.entityUuid was null or undefined when calling resumeRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling resumeRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{entity.owner}/{entity.project}/runs/{entity.uuid}/resume`.replace(`{${"entity.owner"}}`, encodeURIComponent(String(requestParameters.entityOwner))).replace(`{${"entity.project"}}`, encodeURIComponent(String(requestParameters.entityProject))).replace(`{${"entity.uuid"}}`, encodeURIComponent(String(requestParameters.entityUuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Resume run
     */
    async resumeRun(requestParameters: ResumeRunRequest): Promise<V1Run> {
        const response = await this.resumeRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Start run tensorboard
     */
    async startRunTensorboardRaw(requestParameters: StartRunTensorboardRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling startRunTensorboard.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling startRunTensorboard.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling startRunTensorboard.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling startRunTensorboard.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/tensorboard/start`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1ProjectEntityResourceRequestToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Start run tensorboard
     */
    async startRunTensorboard(requestParameters: StartRunTensorboardRequest): Promise<void> {
        await this.startRunTensorboardRaw(requestParameters);
    }

    /**
     * Stop run
     */
    async stopRunRaw(requestParameters: StopRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling stopRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling stopRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling stopRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/stop`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Stop run
     */
    async stopRun(requestParameters: StopRunRequest): Promise<void> {
        await this.stopRunRaw(requestParameters);
    }

    /**
     * Stop run tensorboard
     */
    async stopRunTensorboardRaw(requestParameters: StopRunTensorboardRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling stopRunTensorboard.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling stopRunTensorboard.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling stopRunTensorboard.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/tensorboard/stop`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Stop run tensorboard
     */
    async stopRunTensorboard(requestParameters: StopRunTensorboardRequest): Promise<void> {
        await this.stopRunTensorboardRaw(requestParameters);
    }

    /**
     * Stop runs
     */
    async stopRunsRaw(requestParameters: StopRunsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling stopRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling stopRuns.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling stopRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/stop`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1UuidsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Stop runs
     */
    async stopRuns(requestParameters: StopRunsRequest): Promise<void> {
        await this.stopRunsRaw(requestParameters);
    }

    /**
     * Tag runs
     */
    async tagRunsRaw(requestParameters: TagRunsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling tagRuns.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling tagRuns.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling tagRuns.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/tag`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: V1EntitiesTagsToJSON(requestParameters.body),
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Tag runs
     */
    async tagRuns(requestParameters: TagRunsRequest): Promise<void> {
        await this.tagRunsRaw(requestParameters);
    }

    /**
     * Unbookmark run
     */
    async unbookmarkRunRaw(requestParameters: UnbookmarkRunRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling unbookmarkRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling unbookmarkRun.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling unbookmarkRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/unbookmark`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Unbookmark run
     */
    async unbookmarkRun(requestParameters: UnbookmarkRunRequest): Promise<void> {
        await this.unbookmarkRunRaw(requestParameters);
    }

    /**
     * Update run
     */
    async updateRunRaw(requestParameters: UpdateRunRequest): Promise<runtime.ApiResponse<V1Run>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling updateRun.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling updateRun.');
        }

        if (requestParameters.runUuid === null || requestParameters.runUuid === undefined) {
            throw new runtime.RequiredError('runUuid','Required parameter requestParameters.runUuid was null or undefined when calling updateRun.');
        }

        if (requestParameters.body === null || requestParameters.body === undefined) {
            throw new runtime.RequiredError('body','Required parameter requestParameters.body was null or undefined when calling updateRun.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{run.uuid}`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"run.uuid"}}`, encodeURIComponent(String(requestParameters.runUuid))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: V1RunToJSON(requestParameters.body),
        });

        return new runtime.JSONApiResponse(response, (jsonValue) => V1RunFromJSON(jsonValue));
    }

    /**
     * Update run
     */
    async updateRun(requestParameters: UpdateRunRequest): Promise<V1Run> {
        const response = await this.updateRunRaw(requestParameters);
        return await response.value();
    }

    /**
     * Upload an artifact file to a store via run access
     */
    async uploadRunArtifactRaw(requestParameters: UploadRunArtifactRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling uploadRunArtifact.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling uploadRunArtifact.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling uploadRunArtifact.');
        }

        if (requestParameters.uploadfile === null || requestParameters.uploadfile === undefined) {
            throw new runtime.RequiredError('uploadfile','Required parameter requestParameters.uploadfile was null or undefined when calling uploadRunArtifact.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        if (requestParameters.overwrite !== undefined) {
            queryParameters['overwrite'] = requestParameters.overwrite;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const consumes: runtime.Consume[] = [
            { contentType: 'multipart/form-data' },
        ];
        // @ts-ignore: canConsumeForm may be unused
        const canConsumeForm = runtime.canConsumeForm(consumes);

        let formParams: { append(param: string, value: any): any };
        let useForm = false;
        // use FormData to transmit files using content-type "multipart/form-data"
        useForm = canConsumeForm;
        if (useForm) {
            formParams = new FormData();
        } else {
            formParams = new URLSearchParams();
        }

        if (requestParameters.uploadfile !== undefined) {
            formParams.append('uploadfile', requestParameters.uploadfile as any);
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/artifacts/upload`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: formParams,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Upload an artifact file to a store via run access
     */
    async uploadRunArtifact(requestParameters: UploadRunArtifactRequest): Promise<void> {
        await this.uploadRunArtifactRaw(requestParameters);
    }

    /**
     * Upload a logs file to a store via run access
     */
    async uploadRunLogsRaw(requestParameters: UploadRunLogsRequest): Promise<runtime.ApiResponse<void>> {
        if (requestParameters.owner === null || requestParameters.owner === undefined) {
            throw new runtime.RequiredError('owner','Required parameter requestParameters.owner was null or undefined when calling uploadRunLogs.');
        }

        if (requestParameters.project === null || requestParameters.project === undefined) {
            throw new runtime.RequiredError('project','Required parameter requestParameters.project was null or undefined when calling uploadRunLogs.');
        }

        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling uploadRunLogs.');
        }

        if (requestParameters.uploadfile === null || requestParameters.uploadfile === undefined) {
            throw new runtime.RequiredError('uploadfile','Required parameter requestParameters.uploadfile was null or undefined when calling uploadRunLogs.');
        }

        const queryParameters: runtime.HTTPQuery = {};

        if (requestParameters.path !== undefined) {
            queryParameters['path'] = requestParameters.path;
        }

        if (requestParameters.overwrite !== undefined) {
            queryParameters['overwrite'] = requestParameters.overwrite;
        }

        const headerParameters: runtime.HTTPHeaders = {};

        if (this.configuration && this.configuration.apiKey) {
            headerParameters["Authorization"] = this.configuration.apiKey("Authorization"); // ApiKey authentication
        }

        const consumes: runtime.Consume[] = [
            { contentType: 'multipart/form-data' },
        ];
        // @ts-ignore: canConsumeForm may be unused
        const canConsumeForm = runtime.canConsumeForm(consumes);

        let formParams: { append(param: string, value: any): any };
        let useForm = false;
        // use FormData to transmit files using content-type "multipart/form-data"
        useForm = canConsumeForm;
        if (useForm) {
            formParams = new FormData();
        } else {
            formParams = new URLSearchParams();
        }

        if (requestParameters.uploadfile !== undefined) {
            formParams.append('uploadfile', requestParameters.uploadfile as any);
        }

        const response = await this.request({
            path: `/api/v1/{owner}/{project}/runs/{uuid}/logs/upload`.replace(`{${"owner"}}`, encodeURIComponent(String(requestParameters.owner))).replace(`{${"project"}}`, encodeURIComponent(String(requestParameters.project))).replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: formParams,
        });

        return new runtime.VoidApiResponse(response);
    }

    /**
     * Upload a logs file to a store via run access
     */
    async uploadRunLogs(requestParameters: UploadRunLogsRequest): Promise<void> {
        await this.uploadRunLogsRaw(requestParameters);
    }

}

/**
    * @export
    * @enum {string}
    */
export enum GetMultiRunEventsKindEnum {
    Model = 'model',
    Audio = 'audio',
    Video = 'video',
    Histogram = 'histogram',
    Image = 'image',
    Tensor = 'tensor',
    Dataframe = 'dataframe',
    Chart = 'chart',
    Csv = 'csv',
    Tsv = 'tsv',
    Psv = 'psv',
    Ssv = 'ssv',
    Metric = 'metric',
    Env = 'env',
    Html = 'html',
    Text = 'text',
    File = 'file',
    Dir = 'dir',
    Dockerfile = 'dockerfile',
    DockerImage = 'docker_image',
    Data = 'data',
    Coderef = 'coderef',
    Table = 'table',
    Tensorboard = 'tensorboard',
    Curve = 'curve',
    Analysis = 'analysis',
    Iteration = 'iteration'
}
/**
    * @export
    * @enum {string}
    */
export enum GetRunEventsKindEnum {
    Model = 'model',
    Audio = 'audio',
    Video = 'video',
    Histogram = 'histogram',
    Image = 'image',
    Tensor = 'tensor',
    Dataframe = 'dataframe',
    Chart = 'chart',
    Csv = 'csv',
    Tsv = 'tsv',
    Psv = 'psv',
    Ssv = 'ssv',
    Metric = 'metric',
    Env = 'env',
    Html = 'html',
    Text = 'text',
    File = 'file',
    Dir = 'dir',
    Dockerfile = 'dockerfile',
    DockerImage = 'docker_image',
    Data = 'data',
    Coderef = 'coderef',
    Table = 'table',
    Tensorboard = 'tensorboard',
    Curve = 'curve',
    Analysis = 'analysis',
    Iteration = 'iteration'
}
